// component/sharePicker/sharePicker.js
Component({
  /**
   * 组件的属性列表
   */
  properties: {
    shareContent: Object
  },

  /**
   * 组件的初始数据
   */
  data: {
    canvasShow: false,
    shareData: null,
    canvasId: ''
  },

  /**
   * 组件的方法列表
   */
  methods: {
    hiddenMask () {
      this.triggerEvent("cancel")
    },
    /**
    * 生成海报
    */
    creatCanvas: function () {
      console.log('生成海报')
      let shareContent = this.data.shareContent
      console.log(shareContent)
      this.setData({
        canvasId: 'shareImg' + Date.parse(new Date()),
        shareData: shareContent,
        page: 'pages/park/park',
        canvasShow: true,
      })
      console.log('打开组件画图', shareContent)
    },
    /**
     * 事件 - canvas分享 园区
     */
    sharePark: function (e) {
      this.setData({
        shareData: e.currentTarget.dataset.item,
        page: 'pages/park/park',
        canvasId: 'shareImg' + Date.parse(new Date()),
        canvasShow: true,
      })
      console.log('打开组件画图', e.currentTarget.dataset.item)
    },
  }
})
